﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BiffenApplication.ServiceReference2;

namespace BiffenApplication
{
    public partial class Login : Form
    {
        RemoteBookingSystemClient cli = new RemoteBookingSystemClient();
        public Login()
        {
            InitializeComponent();
        }

        private void loginBtn_Click(object sender, EventArgs e)
        {
            //string userName = usernameTb.Text;
            int id = 1;
            try
            {
                if (usernameTb.Text.Equals(cli.GetOneEmployee(id).UserName) && passwordTb.Text.Equals(cli.GetOneEmployee(id).Password))
                {
                    MainMenu main = new MainMenu();
                    main.Show();
                    this.Hide();
                }

                //if (usernameTb.Text.Equals(cli.GetEmployeeUserName(userName).UserName) && passwordTb.Text.Equals(cli.GetEmployeeUserName(userName).Password))
                //{
                //    lblError.Text = "true";
                //    //MainMenu main = new MainMenu();
                //    //main.Show();
                //    //this.Hide();
                //}

            }
            catch (Exception ex)
            {
                lblError.Text = "false" + ex;
            }
        }
    }
}
